<?php


namespace app\models;

use yii\base\Model;

class test extends Model{
	public $username;
	public $password;
	public $repassword;
	public $age;
	public $number;
	public $email;
	public $sex;
	public $pt;
	public $str;


	public function rules(){
		return [
			[['password' , 'username'] , 'required' , 'message' => '不能为空'],
			
		];
	}


	public function checkUsername($attribute , $params){
		//print_r($params);
		//echo $this->$attribute , '<br />';
		if($this->$attribute != 'smister'){
			$this->addError($attribute , $params['message']);
		}
	}
/*
class admin extends Model{
		public $username;
		public $password;
		public function rules(){
		return [	
			[['password' , 'username'] , 'required' , 'message' => '不能为空'],
		];
	}

	}
 */
}








?>